function setPinDigitsX(prefix) {
	var ordered = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
	var rand = ordered.sort(randomCompare);
	var sID = null;
	var sIDAnchor = null;
	var tdControl = null;
	var tdImageControl = null;
	var anchor = null;
	
	for (i = 0; i < 10; i++)
	{
		sID = prefix + "digit" + i.toString();
		sIDAnchor = prefix + "link" + i.toString();
		if ( !document.getElementById || !document.getElementById(sID) )
			continue;			
		tdControl = document.getElementById(sID);
		anchor = document.getElementById(sIDAnchor);
		anchor.href="javascript:setPasswdX('" + rand[i].toString() + "', '" + prefix + "');";
		
		sID = prefix + "digitImage" + i.toString();	
		if ( document.getElementById(sID) != null ) {
			tdImageControl = document.getElementById(sID);
			tdImageControl.src="../Images/content/keypad/" + rand[i].toString() + ".png";
			tdImageControl.alt= rand[i].toString();
		}
	}
}

function randomCompare(a, b) {	return (Math.random() < 0.5) ? -1 : 1;}
function setPasswdX(a, prefix) {	setPasswdXLen(a, prefix, 4);}
function setPasswdXLen(a, prefix, maxlen){	var control =null;	control = document.getElementById(prefix + "inputUserPassword");	if ( control.value.length < maxlen )		control.value += a;}
